package com.transaction.controller;

import com.transaction.entity.Student;
import com.transaction.service.StudentService;
import com.transaction.util.SuperTransaction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with LXD
 *
 * @author:Luhui
 * @qq:729913162
 * @Date:2018-09-22
 * @Time:11:39
 */
@RestController
@RequestMapping("/student")
public class StudentController {

    @Autowired
    public StudentService studentService;


    @GetMapping("/add")
    @SuperTransaction
    public boolean addStudent(Student student){
        System.out.println(this.toString());
        test();
        return studentService.addStudent(student);
    }

    @SuperTransaction
    public void test(){
        System.out.println("111111111111111111111111111");
    }
}
